<template>
  <div>
    <top-nav/>
    <router-view></router-view>
    <footer-info/>
  </div>
</template>

<script>
import topNav from './components/topNav/topNav.vue'
import footerInfo from './components/footerInfo/footerInfo'

export default {
  name: 'App',
  components: {
    topNav,
    footerInfo
  },
  mounted: function () {
    this.$http.post('/java_kunpeng/getinfo')
      .then((response) => {
        const json = response.data
        if (json.state === '0') {
          this.$store.dispatch('login', json.info)
        } else {
          console.log('unlogin!')
        }
      })
      .catch((error) => {
        console.log(error)
      })
  }
}
</script>

<style>
  *{margin: 0px;}
</style>
